const entryHandler = (list) => {
	const entries = list.getEntries()
	for (let entry of entries) {
		if (observer) {
			observer.disconnect()
		}
		const reportData = {
			type: entry.entryType,
			name: entry.name,
			duration: entry.duration,
			initiatorType: entry.initiatorType,
			transferSize: entry.transferSize,
			encodedBodySize: entry.encodedBodySize,
			decodedBodySize: entry.decodedBodySize
			// startTime: entry.startTime,
			// entryType: entry.entryType,
		}

		console.log('%c [  ]-11', 'font-size:13px; background:pink; color:#bf2c9f;', reportData)
	}
	// entries.forEach((entry) => console.log(entry)) // 打印资源加载信息
}
const observer = new PerformanceObserver(entryHandler)
observer.observe({ type: ['resource'], buffered: true })
